<ui:composition template="/WEB-INF/templates/defaultLayout.xhtml" 
				xmlns="http://www.w3.org/1999/xhtml"
				xmlns:h="http://java.sun.com/jsf/html"
	  			xmlns:p="http://primefaces.org/ui" 
	  			xmlns:f="http://java.sun.com/jsf/core"
      			xmlns:ui="http://java.sun.com/jsf/facelets">

	<ui:define name="title">
		#{lang.getTrans("ui.mobile.customer.title")}
	</ui:define>
	
	<ui:define name="layoutCenter">
		<h:form id="form">
			<p:growl id="growl"/>
			<p:breadCrumb>
				<p:menuitem value="#{lang.getTrans('ui.mobile.common.bread.home')}" url="/home.xhtml"/>
				<p:menuitem value="#{lang.getTrans('ui.mobile.common.bread.customer')}" url="/crud/customer/customerList.xhtml"/>
			</p:breadCrumb>
			<p:dataTable id="basic" var="customer" value="#{customerBean.customers}" paginator="true" 
			rows="15" 	paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} 
			{NextPageLink} {LastPageLink} {RowsPerPageDropdown}" >
			
				<p:column id="idCustomerEditDelete" style="width:14px; text-align:center;" sortBy="#{customer.idCustomer}">
					<f:facet name="header">	
						<p:commandButton style="width:18px;height:18px;" title="#{lang.getTrans('ui.mobile.common.new')}" 
						icon="ui-icon-circle-plus" action="#{customerBean.toForm}"/>				
					</f:facet>
					<p:commandButton style="width:18px;height:18px;" title="#{lang.getTrans('ui.mobile.common.delete')}" 
						icon="ui-icon-trash" action="#{customerBean.remover}" update="@form">  
   						<f:setPropertyActionListener target="#{customerBean.customer}" value="#{customer}" />
					</p:commandButton> 
				</p:column>
				
				<p:column style="width:14px;">
					<p:commandButton style="width:18px;height:18px;" title="#{lang.getTrans('ui.mobile.common.edit')}" 
						icon="ui-icon-circle-triangle-e" action="#{customerBean.toForm}">  
   						<f:setPropertyActionListener target="#{customerBean.customer}" value="#{customer}" />  
					</p:commandButton>  							
				</p:column>
			
				<p:column id="cdCustomer" sortBy="#{customer.cdCustomer}">
					<f:facet name="header">	#{lang.getTrans("ui.mobile.customer.name")}  </f:facet>
					<h:outputText value="#{customer.cdCustomer}"/>	
				</p:column>
				
				<p:column id="cdEmail" sortBy="#{customer.cdEmail}">
					<f:facet name="header">	#{lang.getTrans("ui.mobile.customer.email")} </f:facet>
					<h:outputText value="#{customer.cdEmail}"/>	
				</p:column>
				
				<p:column id="cdPhone" sortBy="#{customer.cdPhone}">
					<f:facet name="header">	#{lang.getTrans("ui.mobile.customer.phone")} </f:facet>
					<h:outputText value="#{customer.cdPhone}"/>	
				</p:column>		
			</p:dataTable>
		</h:form>
	</ui:define>
</ui:composition>
